package com.sdgakj.repository;

import com.sdgakj.entity.FeedLike;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;

import java.util.List;

public interface FeedLikeDao extends PagingAndSortingRepository<FeedLike, Long>, JpaSpecificationExecutor<FeedLike> {
	
	/**
	 * 根据用户id和feedid获取赞
	 * 
	 * @param userId
	 * @param feedId
	 * @return
	 */
 	public 	FeedLike findByUserIdAndFeedId(Long userId, Long feedId);

	/**
	 * 分页查询点赞
	 * @param feedId
	 * @return
	 */
	public List<Object[]> findPageLikeLoginName(Long feedId, Integer pageNumber, Integer pageSize);

	/**
	 * 查询贴子的所有点赞
	 * @param feedId
	 * @return
	 */
	public Long getTotalCount(Long feedId);
}
